<template>
  <div>
    <p ref="pRef">HomeView</p>
    <!-- 组件上的 ref 可以获取组件所有的内容 -->
    <elButton ref="elBtn"></elButton>
    <button @click="decrement">减</button>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import elButton from '@/components/elButton.vue';
const pRef = ref()

const elBtn = ref()

onMounted(() => {
  console.log(pRef.value)
})

const decrement = () => {
  elBtn.value.count--
}
</script>

<style lang="scss" scoped>

</style>